package com.yc.cloud.openai.portal.enums;


import lombok.Getter;

import java.util.Objects;

@Getter
public enum TextToSpeechProvider {
    //这里的value值需要跟CLIENT_NAME保持一致,@Component("CHAT_TTS") ChatTTSClient
    CHAT_TTS("1", "CHAT_TTS"),
    //科大讯飞
    XUN_FEI("2", "XUN_FEI"),
    //微软云
    AZURE("3", "AZURE");


    private final String key;
    private final String value;

    TextToSpeechProvider(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static TextToSpeechProvider fromKey(String key) {
        for (TextToSpeechProvider provider : TextToSpeechProvider.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        return null;
        // throw new IllegalArgumentException("Unknown provider key: " + key);
    }
}

